/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.model;

import org.jfonia.connect5.basics.BasicValueNode;
import org.jfonia.connect5.basics.MutableValueNode;
import org.jfonia.connect5.intervals.BasicIntInterval;

/**
 *
 * @author jannes
 */
public class TempoNode extends BasicIntInterval{
    private MutableValueNode<Integer> bpm;

    public TempoNode(){        
        bpm = new BasicValueNode<Integer>(120);
    }

    public int getBPM(){
        return bpm.getValue();
    }

    public MutableValueNode<Integer> getBPMNode(){
        return bpm;
    }

    public void setBPM(int bpm){
        this.bpm.setValue(bpm);
        getEndNode().notifyObservers();        
    }

    @Override
    public TempoNode clone(){
        TempoNode tn = new TempoNode();
        tn.setBPM(bpm.getValue());
        return tn;
    }
}
